<template>
   <el-menu
    :style="{ width: !isCollapse ? '230px' : '64px' }"
     active-text-color="#ffd04b"
     background-color="#545c64"
     class="aside-container"
     text-color="#fff"
     :collapse="isCollapse"
     @open="handleOpen"
     @close="handleClose"
     :default-active="active"
   >
     <p class="logo-lg">{{ isCollapse ? 'DIDI' : 'DIDI陪诊' }}</p>
      <TreeMenu :index="1" :menuData="menuData"/>
     </el-menu>
</template>

<script setup>
import TreeMenu from './treeMenu.vue'
import { useRouter } from 'vue-router'
import { reactive, computed } from 'vue'
import { useHomeStore } from '../stores/home'

const handleOpen = () => {}
const handleClose = () => {}
const router = useRouter()
// const menuData = reactive(router.options.routes[0].children)
const menuData = computed(() => homeStore.routerList)

const homeStore = useHomeStore()
const isCollapse = computed(() => homeStore.isCollapse)
const active = computed(() => homeStore.menuActive)
</script>

<style lang="less" scoped>
.aside-container {
   height: 100%;
   .logo-lg {
     font-size: 20px;
     text-align: center;
     height: 40px;
     line-height: 40px;
     color: #fff
   }
}
</style>